<?php
namespace model;
use model;
class paymentModel extends model{

    public static function getDefault(){

        $sql = "select * from sh_payment where is_default='1'";
        $result = self::$db->query( $sql );
        return !empty($result->row)?$result->row:false;
    }

    public static function getList(){

        $sql = "select * from sh_payment where active='1'";
        $result = self::$db->query( $sql );
        return !empty($result->num_rows)?$result->rows:false;
    }

    public static function findByCode( $code ){
        $sql = "select * from sh_payment where active='1' and code ='" . $code . "'";
        $result = self::$db->query( $sql );
        return !empty($result->row)?$result->row:false;
    }
}